<template>
	<view>
		<view class="top">
			<u-subsection :list="list" mode="button" :current="currentSubsection" activeColor="#f56c6c"
				@change="changeSub" fontSize='24'>
			</u-subsection>
		</view>
		<!-- 项目进度 -->
		<project-progress :node="node" v-if="currentSubsection === 0 "></project-progress>
		<!-- 项目质量 -->
		<project-quality :node="node" v-if="currentSubsection === 1 "></project-quality>
		<!-- 项目安全 -->
		<project-safe :node="node" v-if="currentSubsection === 2"></project-safe>
		<!-- 项目大事件 -->
		<project-news :node="node" v-if="currentSubsection === 3"></project-news>
	</view>
</template>

<script>
	export default {
		created() {
			console.log(uni.getStorageSync('estateId'))
			this.node.estateId = uni.getStorageSync('estateId')
			this.node.projectId = uni.getStorageSync('projectId')
			this.node.type = 'public'
		},
		data() {
			return {
				list: ['项目进度', '项目质量', '项目安全', '项目大事记'],
				currentSubsection: 0,
				node: {}
			};
		},
		methods: {
			changeSub(index) {
				this.currentSubsection = index
				console.log(index)
			},
		},
		// watch:{
		// 	currentSubsection(newName, oldName) {}
		// }
	}
</script>

<style lang="scss" scoped>
</style>
